package com.tkp.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author: duk
 * @Date: 2021/10/29 14:07
 * @Description: 用户信息
 */
@Data
@ToString
@Validated
@TableName("eb_user")
@EqualsAndHashCode
public class User {
    @TableId(type = IdType.AUTO)
    private Integer userId;
    /**
     * 用户编码
     */
    @NotNull(message = "用户编码不能为空")
    private String userCode;
    /**
     * 用户名称
     */
    @NotNull(message = "用户名称不能为空")
    private String userName;
    /**
     * 银行账户
     */
    private String bankAccount;
    /**
     * 用户密码
     */
    @TableField(select = false)
    private String passWord;
    /**
     * 版本号
     */
    @Version
    private Integer version;
    /**
     * 银行卡
     */
    @TableField(exist = false)
    private List<Bank> bankList;

    public User() {
    }

    public User(Integer userId, String userCode, String userName) {
        this.userId = userId;
        this.userCode = userCode;
        this.userName = userName;
    }
}
